using Godot;
using System;

public partial class ClickButton : Node
{

    private const String source = "按钮点击";

    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        // 1、代码信号绑定
        Button button = this.GetNode<Button>("ClickButton");
        // button.信号事件
        button.Pressed += testPressed;

    }

    // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(double delta)
    {
    }

    // 代码信号
    private void testPressed()
    {
        GD.Print("代码信号");
        Label label = this.GetNode<Label>("Label");
        label.EmitSignal("OnChangeText", source);
    }



}
